#!/usr/bin/env bash
set -e

VERSION=1

# Build JAR and fetch sources
mvn package

# Copy to correct location
mkdir -p lib
cp "target/ci-extras-1.0-SNAPSHOT-jar-with-dependencies.jar" "lib/ci-extras.jar"

# Clean up
mvn clean

# Package component
rm -rf dist && mkdir -p dist
tar czf "dist/ci-extras-${VERSION}.tar.gz" --exclude dist --transform "s/^\\./ci-extras-${VERSION}/" .
